home *** CD-ROM | disk | FTP | other *** search
- #include "QD3DtoQTVR.h"
- #include "extern.h"
- #include "context.h"
-
-
- TQ3DrawContextObject MyNewDrawContext(DocumentPtr theDocument)
- {
- TQ3PixmapDrawContextData myDrawContextData;
- TQ3ColorARGB clearColor = kMyAClearColor;
- GWorldPtr theGWorld ;
- PixMapHandle hPixMap ;
- Rect srcRect ;
-
- theGWorld = theDocument->drawContextOffscreen;
- myDrawContextData.drawContextData.clearImageMethod = kQ3ClearMethodWithColor;
- myDrawContextData.drawContextData.clearImageColor = clearColor;
- myDrawContextData.drawContextData.paneState = kQ3False;
- myDrawContextData.drawContextData.maskState = kQ3False;
- myDrawContextData.drawContextData.doubleBufferState = kQ3False;
-
- hPixMap = GetGWorldPixMap(theGWorld);
- LockPixels(hPixMap);
- srcRect = theGWorld->portRect;
-
- myDrawContextData.pixmap.width = srcRect.right - srcRect.left;
- myDrawContextData.pixmap.height= srcRect.bottom - srcRect.top;
- myDrawContextData.pixmap.rowBytes = (**hPixMap).rowBytes & 0x7FFF;
- myDrawContextData.pixmap.pixelType = kQ3PixelTypeRGB32;
- myDrawContextData.pixmap.pixelSize = (*theGWorld->portPixMap)->pixelSize;
- myDrawContextData.pixmap.bitOrder = kQ3EndianBig;
- myDrawContextData.pixmap.byteOrder = kQ3EndianBig;
- myDrawContextData.pixmap.image = (**hPixMap).baseAddr;
-
- return Q3PixmapDrawContext_New(&myDrawContextData);
- }
-
-